home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / admin / dig-2.0 / dig-2 / dig.2.0 / resolv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-01  |  1.9 KB  |  61 lines

  1.  
  2. /*
  3.  * Copyright (c) 1983, 1987 Regents of the University of California.
  4.  * All rights reserved.  The Berkeley software License Agreement
  5.  * specifies the terms and conditions for redistribution.
  6.  *
  7.  *    @(#)resolv.h    5.5 (Berkeley) 5/12/87
  8.  */
  9.  
  10. /*
  11. ** Distributed with 'dig' version 2.0 from University of Southern
  12. ** California Information Sciences Institute (USC-ISI). 9/1/90
  13. */
  14.  
  15.  
  16. /*
  17.  * Global defines and variables for resolver stub.
  18.  */
  19.  
  20. #ifndef MAXDNAME
  21. #define MAXDNAME        256
  22. #define MAXCDNAME       255
  23. #endif
  24.  
  25. #define    MAXNS        3        /* max # name servers we'll track */
  26. #define    MAXDNSRCH    3        /* max # default domain levels to try */
  27. #define    LOCALDOMAINPARTS 2        /* min levels in name that is "local" */
  28.  
  29. #define    RES_TIMEOUT    4        /* seconds between retries */
  30.  
  31. struct state {
  32.     int    retrans;         /* retransmition time interval */
  33.     int    retry;            /* number of times to retransmit */
  34.     long    options;        /* option flags - see below. */
  35.     int    nscount;        /* number of name servers */
  36.     struct    sockaddr_in nsaddr_list[MAXNS];    /* address of name server */
  37. #define    nsaddr    nsaddr_list[0]        /* for backward compatibility */
  38.     u_short    id;            /* current packet id */
  39.     char    defdname[MAXDNAME];    /* default domain */
  40.     char    *dnsrch[MAXDNSRCH+1];    /* components of domain to search */
  41. };
  42.  
  43. /*
  44.  * Resolver options
  45.  */
  46. #define RES_INIT    0x0001        /* address initialized */
  47. #define RES_DEBUG    0x0002        /* print debug messages */
  48. #define RES_AAONLY    0x0004        /* authoritative answers only */
  49. #define RES_USEVC    0x0008        /* use virtual circuit */
  50. #define RES_PRIMARY    0x0010        /* query primary server only */
  51. #define RES_IGNTC    0x0020        /* ignore trucation errors */
  52. #define RES_RECURSE    0x0040        /* recursion desired */
  53. #define RES_DEFNAMES    0x0080        /* use default domain name */
  54. #define RES_STAYOPEN    0x0100        /* Keep TCP socket open */
  55. #define RES_DNSRCH    0x0200        /* search up local domain tree */
  56.  
  57. #define RES_DEFAULT    (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
  58.  
  59. extern struct state _res;
  60. extern char *p_cdname(), *p_rr(), *p_type(), *p_class();
  61.